home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
msqc25t1
/
tbox.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-27
|
1KB
|
52 lines
/* tbox.c: Outlining windows with text boxes */
#include <conio.h>
#include <graph.h>
#include "textscrn.h"
/* Constants */
#define MAINFORE YELLOW
#define MAINBACK BROWN
#define MSSGFORE BLACK
#define BOXFORE WHITE
#define BOXBACK RED
main()
{
int n;
void prompt (char*);
/* Set up main window, double border */
_savescrn (0); /* save entry screen */
_setbordwindow (2, 2, 22, 79, 2, MAINFORE, MAINBACK);
for (n = 1; n < 22; n++) { /* write some test */
_settextposition (n, n + 5);
_outtextf ("This is at row %d, column %d", n, n + 5);
}
prompt ("Press any key for pop-up...");
/* Make a pop-up, single border */
_savescrn(0); /* save display */
_setbordwindow (10, 28, 10, 52, 1, BOXFORE, BOXBACK);
_outtext ("This is a pop-up window");
/* Hold pop-up until keypress */
prompt ("Press any key to restore original screen...");
_restscrn(0); /* restore */
/* Shut down */
prompt ("Press any key to quit...");
_restscrn(0); /* restore entry screen */
}
void prompt (char *mssg)
{ /* write message to command line and wait */
_setbordwindow (24, 1, 24, 80, 0, MSSGFORE, MAINBACK);
_outtext (mssg);
getch();
}